package wbbs.web.admin;

import cn.webwheel.LogicException;
import cn.webwheel.results.RedirectResult;

import java.sql.SQLException;

public class BaseAction extends wbbs.web.BaseAction {

    public void ensureLoginAction() throws SQLException {
        super.ensureLoginAction();
        if (!loginUser.id.equals("admin")) {
            throw new LogicException(err("请登录"));
        }
    }

    public void ensureLoginPage() throws SQLException {
        super.ensureLoginPage();
        if (!loginUser.id.equals("admin")) {
            throw new LogicException(new RedirectResult("/login.html"));
        }
    }
}
